﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 订单管理系统窗体应用
{
    public partial class RemoveForm : Form
    {
        MainForm mainForm;
        public RemoveForm(MainForm mainForm)
        {
            InitializeComponent();
            this.mainForm = mainForm;
        }

        private void RemoveButton_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(IDInput.Text))
            {
                MessageBox.Show("ID不能为空");
            }
            else
            {
                int id = int.Parse(IDInput.Text);
                mainForm.remove(id);
                this.Close();
            }
        }

        private void Cancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
